﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Arizu.Entity;
using Arizu.Repository;
using System.Web.SessionState;

namespace AiRiZu.User.handler
{
    public class UpdateNotificationInfo : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            if (context.Session["logId"] == null)
            {
                return;
            }
            UserEntity user = new UserEntity();

            user.UserId = long.Parse(context.Session["logId"].ToString());

            user.EmailNotification = long.Parse(context.Request.Params["phoneRes"].ToString());

            user.SMSNotification = long.Parse(context.Request.Params["smsRes"].ToString());

            AirizuUser airizuUser = AirizuUser.CreateInstance();

            airizuUser.UpdateUserNotificationInfo(user);
            
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
